1. Technical Field
The present invention relates generally to image processing, and more particularly to techniques for minimizing blocking artifacts in videos.
2. Description of the Related Art
Compression is a reversible conversion of data to a format that requires fewer bits, usually so performed that the data can be stored or transmitted more efficiently. In the area of video applications, compression or coding is performed when an input video stream is analyzed and information that is indiscernible to the viewer is discarded. Each event is then assigned a code—commonly occurring events are assigned few bits and rare events have more bits. The common techniques for video compression (e.g., MPEG-1, MPEG-2) divide images in small square blocks for processing. However, real objects in a scene are rarely a collection of square regions. Such block-based coding technique is used in many video compression standards, such as H.261, H.263, H.264, MPEG-1, MPEG-2, and MPEG4. When the compression ratio is increased, the compression process can create visual artifacts in the decoded images when displayed, referred to as blocking artifacts. The blocking artifacts occur along the block boundaries in an image and are caused by the coarse quantization of transform coefficients.
Image filtering techniques can be used to reduce the blocking artifacts in reconstructed images. The reconstructed images are the images produced after being inverse transformed or decoded. The rule of thumb in these techniques is that image edges should be smoothed while the rest of the image is preserved. Low pass filters are carefully chosen based on the characteristic of a particular pixel or set of pixels surrounding the image edges. In particular, non-correlated image pixels that extend across block boundaries in images are specifically filtered to reduce the blocking artifacts. However, such ideal low pass filtering is difficult to design, the commonly used low pass filtering can introduce blurring artifacts into the image. If there are little or no blocking artifacts between adjacent blocks, the low pass filtering may needlessly incorporate blurring into the image while at the same time wasting processing resources.
Various techniques have been proposed to remove the artifacts while preserving the video quality. One of the techniques is to determine the differences in least significant bits (LSB). For example, two adjacent pixels A and B along an image boundary have values 100 and 101 respectively, on a scale of 0 to 255 (8-bit precision). To simply remove the image boundary, it is ideal to replace both pixels with an average value 100.5. But given an 8-bit precision representation for the pixel values, the value 100.5 needs to be rounded up or down. In a standard blurring process, 100.5 may be rounded down to 100 for pixel A (since it was originally closer to 100) and rounded up to 101 for pixel B (since it was originally closer to 101). The consequence is that the values of the two adjacent pixels A and B do not change by the blurring method, and the image boundary is not eliminated.
In certain encoding techniques, the block sizes vary depending on the content in a block. Smooth areas sometimes have large blocks. When blurred, the rectangular areas may be still visible. For example, FIG. 1 shows a gray image in which the pixel values are gradually increasing from the top left corner to the bottom right corner. However, human eyes can perceive a lot of bands in the digital image. These bands may be what are referred to as Mach bands that exaggerate the change in intensity at any boundary where there is a discontinuity in magnitude or slope of intensity. Such bands are not desirable in smooth areas in a scene.
Thus techniques are needed to minimize these visual artifacts to preserve or enhance video quality.